namespace BootstrapBlazorApp.Server.LLMs.function.Kimi;


using Newtonsoft.Json;
using System.Collections.Generic;

public class KimiToolInput
{
    [JsonProperty(PropertyName = "type")] 
    public string Type { get; set; } = "function";

    [JsonProperty(PropertyName = "function")]
    public required Function Function { get; set; }
}

public class Function
{
    [JsonProperty(PropertyName = "name")]
    public required string Name { get; set; }

    [JsonProperty(PropertyName = "description")]
    public string? Description { get; set; }

    [JsonProperty(PropertyName = "parameters")]
    public Parameters? Parameters { get; set; }
}

public class Parameters
{
    [JsonProperty(PropertyName = "type")] 
    public string Type { get; set; } = "object";

    [JsonProperty(PropertyName = "required")]
    public List<string>? Required { get; set; }

    [JsonProperty(PropertyName = "properties")]
    public Dictionary<string, ArgDescription> Properties { get; set; } = new Dictionary<string, ArgDescription>();
    
    public Parameters() { }

    public Parameters(Dictionary<string, ArgDescription> properties,List<string> required)
    {
        Type = "object";
        Properties = properties;
        Required = required;
    }
}

public class ArgDescription
{
    [JsonProperty(PropertyName = "type")] 
    public required string Type { get; set; }

    [JsonProperty(PropertyName = "description")]
    public string? Description { get; set; }
}
